// Resource Manager
// (c) jimon game studio

#ifndef JEH_CRESOURCEMANAGER
#define JEH_CRESOURCEMANAGER

#include "IResourceManager.h"

namespace je
{
	namespace media
	{
		//! Resource Manager
		class CResourceManager:public je::media::IResourceManager
		{
		protected:
			core::IDataBase * CurrentDataBase;

			typedef jeMap<jeStringc,IResourceFactory*> ResourceMapType;
			ResourceMapType ResourceMap;
		public:
			//! Destructor
			CResourceManager();

			//! Destructor
			~CResourceManager();

			//! Set DataBase
			void SetDataBase(core::IDataBase * DataBase);

			//! Get Data Base
			core::IDataBase * GetDataBase();

			//! Get Resource
			IResource * GetResource(const jeStringc & ResourceType,const jeStringc & ResourceName);

			//! Get Resource Factory
			IResourceFactory * GetResourceFactory(const jeStringc & ResourceType);

			//! Register Resource Factory
			void RegisterResourceFactory(IResourceFactory * Factory);

			//! Garbage Collector
			void GarbageCollector();
		};
	}
}

#endif
